<template>
  <div class="app-container">
    <!-- 基础信息 -->
    <h5 class="titleInfo">基础信息</h5>
    <el-form ref="form"  label-width="130px">
      <el-row>
        <el-col :span="12">
          <el-form-item label="用户ID">
            <span class="spanToInput">{{ params.user_id }}</span>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="用户手机号">
            <span class="spanToInput">{{ params.user.username||'' }}</span>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="用户类型">
            <span class="spanToInput">{{ params.user_role }}</span>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="福袋领取情况">
            <span class="spanToInput">{{ params.status==1?'已完成':'未完成' }}</span>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="提交时间">
            <span class="spanToInput">{{ params.created_at }}</span>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="领取时间">
            <span class="spanToInput">{{ params.ended_at }}</span>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
    <!-- 推荐人信息 -->
    <div class="divBar" />
    <h5 class="titleInfo">任务完成情况</h5>
    <el-table :data="params.setting" style="width: 100%">
      <el-table-column prop="id" label="任务" align="center" />
      <el-table-column prop="status" label="完成情况" align="center" />
      <el-table-column prop="detail" label="具体信息" align="center" />
    </el-table>
  </div>
</template>
<script>
import participants from '@/api/participants'
export default {
  data() {
    return {
      tableData: [],
      params: {
        user:{}
      }
    }
  },
  created() {
    this.list()
  },
  methods: {
    async list() {
      console.log(participants)
      const res = await participants.detail({ id: this.$route.query.id })
      if (res.data.code == 200) {
        this.params = JSON.parse(JSON.stringify(res.data.data))
        
      } else {
        this.$message.error(res.data.msg)
      }
    }
  }
}
</script>
